<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMachineTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('machine', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('server_id')->comment('服务器id');
            $table->char('ip',15)->comment('000.000.000.000');
            $table->char('pwd',15)->comment('root密码：wabhnIHPQxjf');
            $table->unsignedSmallInteger('cpu')->comment('cpu数量');
            $table->unsignedSmallInteger('memory')->comment('内存大小G');
            $table->unsignedSmallInteger('mbps')->comment('带宽M');
            $table->integer('price')->comment('价格/月');
            $table->timestamp('end_time')->comment('到期时间');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('machine');
    }
}
